package com.handle.system.api.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 操作日志
 * </p>
 *
 * @author zhangqing
 * @since 2021-07-16
 */
@Data
@SuperBuilder(toBuilder = true)
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
public class SysOperateLog implements Serializable {


    private Long id;

    /**
     * 租户code
     */
    private String tenantCode;

    /**
     * 模块标题
     */
    private String moduleTitle;

    /**
     * 业务类型(0:其它 1:新增 2:修改 3:删除 4:授权 5:导出 6:导入)
     */
    private String businessType;

    /**
     * 方法链路 格式com.xxx.xxx.xxCentroller.findList()
     */
    private String methodLink;

    /**
     * 请求类型 (GET,POST ...)
     */
    private String requestType;

    /**
     * 操作类型 (0其它 1后台用户 2手机端用户)
     */
    private String operatorType;

    /**
     * 操作人
     */
    private String operator;

    /**
     * 请求url
     */
    private String operatorUrl;

    /**
     * ip地址
     */
    private String operatorIp;

    /**
     * 地点
     */
    private String operatorLocation;

    /**
     * 请求参数
     */
    private String operatorParam;

    /**
     * 操作状态 (0:失败 1:成功)
     */
    private Boolean status;

    /**
     * 失败消息
     */
    private String errorMsg;

    /**
     * 操作时间
     */
    @TableField(fill=FieldFill.INSERT)
    private LocalDateTime createTime;


    public static final String ID = "id";

    public static final String TENANT_CODE = "tenant_code";

    public static final String MODULE_TITLE = "module_title";

    public static final String BUSINESS_TYPE = "business_type";

    public static final String METHOD_LINK = "method_link";

    public static final String REQUEST_TYPE = "request_type";

    public static final String OPERATOR_TYPE = "operator_type";

    public static final String OPERATOR = "operator";

    public static final String OPERATOR_URL = "operator_url";

    public static final String OPERATOR_IP = "operator_ip";

    public static final String OPERATOR_LOCATION = "operator_location";

    public static final String OPERATOR_PARAM = "operator_param";

    public static final String STATUS = "status";

    public static final String ERROR_MSG = "error_msg";

    public static final String CREATE_TIME = "create_time";

}
